package com.itheima.mapper;

import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;

@Mapper
public interface UserOrderMapper {
    /**
     * 查询是否重复预约
     * @param orderDate
     * @param memberId
     * @return
     */
    @Select("select * from orders where orderDate=#{orderDate} and member_id=#{memberId} and setmeal_id=#{setmealId} ")
    Order orderExit(Date orderDate, Integer memberId, Integer setmealId);

    /**
     * 添加新的预约
     * @param addOrder
     */
    void insertOrder(Order addOrder);

    /**
     * 根据id进行orders表查询
     * @param checkid
     * @return
     */
    @Select("select *from orders where id =#{checkid}")
    Order findById(Integer checkid);
}
